package com.ruoyi.project.rest.detail.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.rest.detail.mapper.RestOrderDetailMapper;
import com.ruoyi.project.rest.detail.domain.RestOrderDetail;
import com.ruoyi.project.rest.detail.service.IRestOrderDetailService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 订单商品明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-28
 */
@Service
public class RestOrderDetailServiceImpl implements IRestOrderDetailService 
{
    @Autowired
    private RestOrderDetailMapper restOrderDetailMapper;

    /**
     * 查询订单商品明细
     * 
     * @param orderNo 订单商品明细主键
     * @return 订单商品明细
     */
    @Override
    public RestOrderDetail selectRestOrderDetailByOrderNo(String orderNo)
    {
        return restOrderDetailMapper.selectRestOrderDetailByOrderNo(orderNo);
    }

    /**
     * 查询订单商品明细列表
     * 
     * @param restOrderDetail 订单商品明细
     * @return 订单商品明细
     */
    @Override
    public List<RestOrderDetail> selectRestOrderDetailList(RestOrderDetail restOrderDetail)
    {
        return restOrderDetailMapper.selectRestOrderDetailList(restOrderDetail);
    }

    /**
     * 新增订单商品明细
     * 
     * @param restOrderDetail 订单商品明细
     * @return 结果
     */
    @Override
    public int insertRestOrderDetail(RestOrderDetail restOrderDetail)
    {
        return restOrderDetailMapper.insertRestOrderDetail(restOrderDetail);
    }

    /**
     * 修改订单商品明细
     * 
     * @param restOrderDetail 订单商品明细
     * @return 结果
     */
    @Override
    public int updateRestOrderDetail(RestOrderDetail restOrderDetail)
    {
        return restOrderDetailMapper.updateRestOrderDetail(restOrderDetail);
    }

    /**
     * 批量删除订单商品明细
     * 
     * @param orderNos 需要删除的订单商品明细主键
     * @return 结果
     */
    @Override
    public int deleteRestOrderDetailByOrderNos(String orderNos)
    {
        return restOrderDetailMapper.deleteRestOrderDetailByOrderNos(Convert.toStrArray(orderNos));
    }

    /**
     * 删除订单商品明细信息
     * 
     * @param orderNo 订单商品明细主键
     * @return 结果
     */
    @Override
    public int deleteRestOrderDetailByOrderNo(String orderNo)
    {
        return restOrderDetailMapper.deleteRestOrderDetailByOrderNo(orderNo);
    }
}
